// 学生的对象，由班主任进行添加
class Student{
    String name = ''; // 姓名    
    String sex = ''; //性别
    Date birthday ; // 生日
    Classes classes;
    String level = '';
    boolean state = false;//在校、离校状态    true为离校
    String source = '';  //离校原因
    String address = '';
    String post = '';
    School school;
    Parent parent
    boolean enabled = true
    boolean hasBlog = false;
    static mapping = {
       table 'xedu_student'

       sort name:'asc'
    }

    static constraints = {
        parent unique:true
        name(size: 1..50, blank: false);
        sex(size: 1..4,blank: true)
        birthday(nullable:true)
        address(size: 1..250,blank: true)
        post(size: 1..10,blank: true)
        source(size: 1..1000)
        classes(nullable:true)
        school(nullable:true)
        parent(nullable:true)
        enabled()
    }


    String toString() {
        "${name}"
    }
}
